#include <QtCore/QCoreApplication>
#include <functional>
#include <iostream>

std::function<void()> funPtr1;
std::function<int(int, int)> funPtr2;

int max(int x, int y)
{
	if (x > y) return x;
	else  return y;
}
int main(int argc, char *argv[])
{
    QCoreApplication a(argc, argv);

	funPtr2 = max;
	std::cout << max(2, 3) << std::endl;

	std::function<int(int)> isGreatThen3 = std::bind(max, std::placeholders::_1, 3);
	std::cout << isGreatThen3(5);
    return a.exec();
}
